const http = require('../../../utils/http.js');
Page({
  data: {
    locations: []
    
  },

  onLoad() {
    this.getLocations();
    
  },

  getLocations() {
    http.get('/city/list').then(res =>{
      console.log(res);
          this.setData({
            locations: res.data
          });
    }).catch(err=>{
      console.log(err);
      wx.showToast({
        title: '系统错误，请稍后重试',
        icon: Error
      })
    })
  },
});